package hausaufgaben;

import javax.swing.JOptionPane;

public class TestMatrix {
	public static void main(String[] args) {
		for(int i = 0; i<10; i++){
			String values = JOptionPane.showInputDialog("Elemente der "+(i+1)+". Matrix:");
			Matrix m = null;
			try {			
				m = new Matrix(values);
			System.out.println("Matrix "+(i+1)+": "+m.toString());
			System.out.println("Determinante: "+m.getDeterminante());
			System.out.println("Inverse Matrix: "+m.getInverse().toString());
			
			} catch (NumberFormatException e){
				System.out.println("Fehler: Nur 4 Dezimalzahlen eingeben.");
			} catch (ArithmeticException e){
				System.out.println(e.getMessage());				
			}
			System.out.println();
		}
	}
}